#pragma once
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include "GL/glew.h"

const float YAW = -0.0f;
const float PITCH = 0.0f;
const float SPEED = 25000.0f;
const float SENSITIVITY = 1.0f;
const float ZOOM = 45.0f;
#define EPSILON 1e-5f
#define PI 3.1415927f

enum Camera_Movement {
	FORWARD,
	BACKWARD,
	LEFT,
	RIGHT
};

class Camera
{
public:
	Camera();
	Camera(float posX, float posY, float posZ, float upX, float upY, float upZ, float yaw, float pitch);
	glm::mat4 GetProjectMatrix(int SCR_WIDTH, int SCR_HEIGHT);
	glm::mat4 GetViewMatrix();
	void ProcessKeyboard(Camera_Movement direction, float deltaTime);
	void ProcessMouseMovement(float xoffset, float yoffset);
    void ProcessTranslate(int xoffset, int yoffset, int SCR_WIDTH, int SCR_HEIGHT);
	void ProcessMouseScroll(float yoffset);

private:
	float FloatClamp(float f, float min, float max);
	glm::vec3 CalculateOffset(glm::vec3 from_target, float yaw, float pitch);
	void UpdateCameraVectors();

	glm::vec3 Position;
	glm::vec3 targetPos;
	glm::vec3 Front;
	glm::vec3 Up;
	glm::vec3 Right;
	glm::vec3 WorldUp;
    glm::mat4 m_ViewMatrix;
	// euler Angles
	float Yaw;
	float Pitch;
	// camera options
	float MovementSpeed;
	float MouseSensitivity;
	float Zoom;
	float ZoomLevel;
};

